package notebook;

import java.util.ArrayList;
import java.util.Arrays;

public class NoteBook {
    private ArrayList<String> notes=new ArrayList<String>();
    public void add(String s)
    {
        notes.add(s);
    }
    public void add(String s,int location)
    {
        notes.add(location,s);
    }
    public int getSize()
    {
        return notes.size();
    }
    public String getNode(int index)
    {
        return notes.get(index);
    }
    public void removeNote(int index)
    {
        notes.remove(index);
    }
    public String[] list(){
        String[] a=new String[notes.size()];
        for(int i=0;i<notes.size();i++)
        {
            a[i]=notes.get(i);
        }
        return a;
    }
    public static void main(String[] args) {
        NoteBook nb=new NoteBook();
        nb.add("first");
        nb.add("second");
        nb.add("third",1);
        //nb.removeNote(1);
        System.out.println(nb.getSize());
        System.out.println(nb.getNode(0));
        System.out.println(nb.getNode(1));
        nb.removeNote(1);
        String[] a= nb.list();
        for(int i=0;i<nb.getSize();i++)
        {
            System.out.println(a[i]);
        }
        System.out.println(a.length);
    }
}
